package com.cctv.custom.hibernate.integrated.wrapper;

import java.io.Serializable;
import java.util.List;

import org.hibernate.Session;
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Order;

public interface CommonDao {

	public Session getSession();

	public void saveOrUpdate(Object obj);

	public boolean delete(Object obj);

	public <T> boolean delete(Class<T> obj, Serializable id);

	public <T> T find(Class<T> obj, Serializable id);

	public <T> List<T> list(Class<T> target,
			List<? extends Criterion> criterions);

	public <T> List<T> list(Class<T> target,
			List<? extends Criterion> criterions, Order[] orders);

	public <T> List<T> list(Class<T> target,
			List<? extends Criterion> criterions, int first,
			int pageSize, Order[] orders);

}
